import React, {Component} from 'react';
import News from "./News";
import MyNavLink from "../../components/MyNavLink";
import {Route, Routes } from 'react-router-dom';
import Message from "./Message";
import MessageDetail from "./Message/MessageDetail";

class Home extends Component {
    render() {
        return (
            <div>
                <h2>Home组件内容</h2>
                <div>
                    <ul className="nav nav-tabs">
                        <li>
                            {/*<a className="list-group-item active" href="./home-news.html">News</a>*/}
                            <MyNavLink to="/home/news">News</MyNavLink>
                        </li>
                        <li>
                            {/*<a className="list-group-item " href="./home-message.html">Message</a>*/}
                            <MyNavLink to="/home/message">Message</MyNavLink>
                        </li>
                    </ul>
                    <Routes>
                        <Route path="/home/news" element={<News/>} />
                        <Route path="/home/message" element={<Message/>} >
                            <Route path="detail" element={<MessageDetail/>}/>
                        </Route>
                        <Route path="*" element={<News/>} />
                    </Routes>

                </div>
            </div>
        );
    }
}

export default Home;